<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/favicon-apple.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon16.png">
  <link rel="mask-icon" href="/images/skylogo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"skygiter.gitee.io","root":"/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"right","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":true,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="什么是 uni-app?   uni-app 是一个使用 Vue.js 开发所有前端应用的框架，开发者编写一套代码，可发布到iOS、Android、H5、以及各种小程序（微信&#x2F;支付宝&#x2F;百度&#x2F;头条&#x2F;QQ&#x2F;钉钉&#x2F;淘宝）、快应用等多个平台。       DCloud公司拥有500万开发者用户，几十万应用案例、10亿手机端月活用户，数千款uni-app插件、70+微信&#x2F;qq群。       uni-app">
<meta property="og:type" content="article">
<meta property="og:title" content="uni-app快速入门">
<meta property="og:url" content="http://skygiter.gitee.io/2020/09/15/UniApp/index.html">
<meta property="og:site_name" content="Skygit的技术博客">
<meta property="og:description" content="什么是 uni-app?   uni-app 是一个使用 Vue.js 开发所有前端应用的框架，开发者编写一套代码，可发布到iOS、Android、H5、以及各种小程序（微信&#x2F;支付宝&#x2F;百度&#x2F;头条&#x2F;QQ&#x2F;钉钉&#x2F;淘宝）、快应用等多个平台。       DCloud公司拥有500万开发者用户，几十万应用案例、10亿手机端月活用户，数千款uni-app插件、70+微信&#x2F;qq群。       uni-app">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-09-14T20:42:57.000Z">
<meta property="article:modified_time" content="2021-01-27T02:55:12.268Z">
<meta property="article:author" content="Skygit">
<meta property="article:tag" content="前端">
<meta property="article:tag" content="uni-app">
<meta property="article:tag" content="vue">
<meta property="article:tag" content="小程序">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="http://skygiter.gitee.io/2020/09/15/UniApp/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>uni-app快速入门 | Skygit的技术博客</title>
  


  <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      if(window.location.href.indexOf('skygiter.gitee.io')!=-1){
        hm.src = "https://hm.baidu.com/hm.js?dba52c6556670659922ba08b29c8abc4";
      }else{
        hm.src = "https://hm.baidu.com/hm.js?31a1d5c2f9d7e9aa48adcb066ec1ed13";
      }
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<link rel="alternate" href="/atom.xml" title="Skygit的技术博客" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Skygit的技术博客</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">闻道有先后,术业有专攻</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-history fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="reading-progress-bar"></div>

  <a href="https://github.com/skygiter" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://skygiter.gitee.io/2020/09/15/UniApp/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Skygit">
      <meta itemprop="description" content="专注于编程技术积累与分享">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Skygit的技术博客">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          uni-app快速入门
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-09-14 20:42:57" itemprop="dateCreated datePublished" datetime="2020-09-14T20:42:57Z">2020-09-14</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-01-27 02:55:12" itemprop="dateModified" datetime="2021-01-27T02:55:12Z">2021-01-27</time>
              </span>
          
              <span title="post.wordcount">
              <span class="post-meta-item-icon">
                <i class="fa fa-newspaper"></i>
              </span>
                字数: <time>1.7k </time>字
              </span>
              <span title="post.min2read">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock"></i>
              </span>
                阅读时长≈
                <time>6  </time>分钟
              </span>
          
          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="什么是-uni-app"><a href="#什么是-uni-app" class="headerlink" title="什么是 uni-app?"></a>什么是 uni-app?</h2><blockquote>
<blockquote>
<blockquote>
<p>uni-app 是一个使用 Vue.js 开发所有前端应用的框架，开发者编写一套代码，可发布到iOS、Android、H5、以及各种小程序（微信/支付宝/百度/头条/QQ/钉钉/淘宝）、快应用等多个平台。</p>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<p>DCloud公司拥有500万开发者用户，几十万应用案例、10亿手机端月活用户，数千款uni-app插件、70+微信/qq群。</p>
</blockquote>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<blockquote>
<p>uni-app在手，做啥都不愁。即使不跨端，uni-app也是更好的小程序开发框架、更好的App跨平台框架、更方便的H5开发框架。</p>
</blockquote>
</blockquote>
</blockquote>
<a id="more"></a>

<h2 id="标签-组件变化"><a href="#标签-组件变化" class="headerlink" title="标签/组件变化"></a>标签/组件变化</h2><p>uni-app参考小程序规范，提供了一批内置组件。</p>
<h3 id="html标签和uni-app内置组件的映射表"><a href="#html标签和uni-app内置组件的映射表" class="headerlink" title="html标签和uni-app内置组件的映射表"></a>html标签和uni-app内置组件的映射表</h3><ul>
<li>div 改成 view</li>
<li>span、font 改成 text</li>
<li>a 改成 navigator</li>
<li>img 改成 image</li>
<li>input 还在，但type属性改成了confirmtype</li>
<li>form、button、checkbox、radio、label、textarea、canvas、video 这些还在。</li>
<li>select 改成 picker</li>
<li>iframe 改成 web-view</li>
<li>ul、li没有了，都用view替代</li>
<li>audio 不再推荐使用，改成api方式，背景音频api文档</li>
<li>其实老的HTML标签也可以在uni-app里使用，uni-app编译器会在编译时把老标签转为新标签，比如把div编译成view。但不推荐这种用法，调试H5端时+ 容易混乱。</li>
</ul>
<h3 id="手机端新增常用新组件"><a href="#手机端新增常用新组件" class="headerlink" title="手机端新增常用新组件"></a>手机端新增常用新组件</h3><ul>
<li>scroll-view 可区域滚动视图容器</li>
<li>swiper 可滑动区域视图容器</li>
<li>icon 图标</li>
<li>rich-text 富文本（不可执行js，但可渲染各种文字格式和图片）</li>
<li>progress 进度条</li>
<li>slider 滑块指示器</li>
<li>switch 开关选择器</li>
<li>camera 相机</li>
<li>live-player 直播</li>
<li>map 地图</li>
<li>cover-view 可覆盖原生组件的视图容器 cover-view需要多强调几句，uni-app的非h5端的video、map、canvas、textarea是原生组件，层级高于其他组件。如需覆盖原生组件，则需要使用cover-view组件。</li>
</ul>
<h2 id="js的变化"><a href="#js的变化" class="headerlink" title="js的变化"></a>js的变化</h2><h3 id="运行环境从浏览器变成v8引擎"><a href="#运行环境从浏览器变成v8引擎" class="headerlink" title="运行环境从浏览器变成v8引擎"></a>运行环境从浏览器变成v8引擎</h3><p>标准js语法和api都支持，比如if、for、settimeout、indexOf等。</p>
<p>但浏览器专用的window、document、navigator、location对象，包括cookie等存储，只有在浏览器中才有，app和小程序都不支持。</p>
<p>可能有些人以为js等于浏览器里的js。其实js是ECMAScript组织管理的，浏览器中的js是w3c组织基于js规范补充了window、document、navigator、location等专用对象。</p>
<p>在uni-app的各个端中，除了h5端，其他端的js都运行在一个独立的v8引擎下，不是在浏览器中，所以浏览器的对象无法使用。如果你做过小程序开发，对此应当很了解。</p>
<p>这意味着依赖document的很多HTML的库，比如jqurey无法使用。</p>
<p>当然app和小程序支持web-view组件，里面可以加载标准HTML，这种页面仍然支持浏览器专用对象window、document、navigator、location。</p>
<h3 id="dom操作，改成vue的MVVM模式"><a href="#dom操作，改成vue的MVVM模式" class="headerlink" title="dom操作，改成vue的MVVM模式"></a>dom操作，改成vue的MVVM模式</h3><p>现在前端趋势是去dom化，改用mvvm模式，更简洁的写法，大幅减少代码行数，同时差量渲染性能更好。</p>
<p>uni-app使用vue的数据绑定方式解决js和dom界面交互的问题。</p>
<p>如果你想改变某个dom元素的显示内容，比如一个view的显示文字：</p>
<p>以前是给view设id，然后js里通过选择器获取dom元素，进一步通过js进行赋值操作，修改dom元素的属性或值。</p>
<h3 id="js-api的变化"><a href="#js-api的变化" class="headerlink" title="js api的变化"></a>js api的变化</h3><p>因为uni-app的api是参考小程序的，所以和浏览器的js api有很多不同，如</p>
<ul>
<li>alert,confirm 改成 uni.showmodel</li>
<li>ajax 改成 uni.request</li>
<li>cookie、session 没有了，local.storage 改成 uni.storage</li>
<li>uni-app的js api还有很多，但基本就是小程序的api，把wx.xxx改为uni.xxx即可。详见</li>
</ul>
<p>uni-app在不同的端，支持条件编译，无限制的使用各端独有的api，<a href="https://uniapp.dcloud.io/platform" target="_blank" rel="noopener">详见条件编译</a></p>
<blockquote>
<blockquote>
<blockquote>
<p>小程序的数据绑定参考了vue，但自己修改了一些。在uni-app中只支持标准的vue，不支持小程序的数据绑定语法<br>小程序里的setData在uni-app里并不存在，因为vue是自动双向数据绑定的。直接通过赋值方式修改数据，如果数据绑定到界面上，界面会自动更新渲染</p>
</blockquote>
</blockquote>
</blockquote>
<h2 id="CSS的变化"><a href="#CSS的变化" class="headerlink" title="CSS的变化"></a>CSS的变化</h2><p>标准的css基本都是支持的。</p>
<p>选择器有2个变化：*选择器不支持；元素选择器里没有body，改为了page。微信小程序即是如此。</p>
<p>单位方面，px无法动态适应不同宽度的屏幕，rem无法用于nvue/weex。如果想使用根据屏幕宽度自适应的单位，推荐使用rpx，全端支持。 尺寸单位文档</p>
<p>uni-app推荐使用flex布局，并默认就是flex布局，这个布局思路和传统流式布局有点区别。但flex的有趣在于，不管是什么技术都支持这种排版，web、小程序/快应用、weex/rn、原生的iOS、Android开发，全都支持flex。它是通吃所有端的新一代布局方案。详见<a href="http://www.ruanyifeng.com/blog/2015/07/flex-grammar.html" target="_blank" rel="noopener">阮一峰flex布局文档</a></p>
<p>uni-app的vue文件里支持所有web排版方式，不管是流式还是flex。但nvue里，只支持flex，因为它在app端是使用原生排版引擎渲染的。</p>
<p>注意css里背景图和字体文件，尽量不要大于40k，因为会影响性能。在小程序端，如果要大于40k，需放到服务器侧远程引用或base64后引入，不能放到本地作为独立文件引用。</p>
<h2 id="工程结构和页面管理"><a href="#工程结构和页面管理" class="headerlink" title="工程结构和页面管理"></a>工程结构和页面管理</h2><p>uni-app的工程结构有单独的要求，<a href="https://uniapp.dcloud.io/frame?id=目录结构" target="_blank" rel="noopener">详见</a></p>
<p>每个可显示的页面，都必须在 pages.json 中注册。如果你开发过小程序，那么pages.json类似app.json。如果你熟悉vue，这里没有vue的路由，都是在pages.json里管理。</p>
<p>原来工程的首页一般是index.html或default.html，是在web server里配的。而uni-app的首页，是在pages.json里配的，page节点下第一个页面就是首页。一般在/pages/xx的目录下。</p>
<p>app和小程序中，为了提升体验，页面提供了原生的导航栏和底部tabbar，注意这些配置是在pages.json中做，而不是在vue页面里创建，但点击事件的监听在显示的vue页面中做。</p>
<p>在vue中，以前的js事件监听概念改为了生命周期概念。详见uni-app生命周期</p>
<p>如果你熟悉小程序开发的话，对比变化如下：</p>
<p>原来app.json被一拆为二。页面管理，被挪入了uni-app的pages.json；非页面管理，挪入了manifest.json<br>原来的app.js和app.wxss被合并到了app.vue中</p>
<h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><ul>
<li><a href="https://uniapp.dcloud.io/" target="_blank" rel="noopener">uni-app官方文档</a></li>
<li><a href="https://ask.dcloud.net.cn/article/35657" target="_blank" rel="noopener">白话uni-app</a></li>
</ul>

    </div>

    
    
    
      <div>
    
        <div style="text-align:center;color: #ccc;font-size:14px;">-------------本文结束<i class="fa fa-paw"></i>感谢您的阅读-------------</div>
    
</div>
        <div class="reward-container">
  <div></div>
  <button onclick="var qr = document.getElementById('qr'); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
      
      <div style="display: inline-block;">
        <img src="/images/alipay.png" alt="Skygit 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>

        

  <div class="followme">
    <p>欢迎关注我的其它发布渠道</p>

    <div class="social-list">

        <div class="social-item">
          <a target="_blank" class="social-link" href="/atom.xml">
            <span class="icon">
              <i class="fa fa-rss"></i>
            </span>

            <span class="label">RSS</span>
          </a>
        </div>

        <div class="social-item">
          <a target="_blank" class="social-link" href="https://github.com/skygiter">
            <span class="icon">
              <i class="fab fa-github"></i>
            </span>

            <span class="label">Github</span>
          </a>
        </div>
    </div>
  </div>

          
      <footer class="post-footer">
          
          <div class="post-tags">
              <a href="/tags/%E5%89%8D%E7%AB%AF/" rel="tag"><i class="fa fa-tag"></i> 前端</a>
              <a href="/tags/uni-app/" rel="tag"><i class="fa fa-tag"></i> uni-app</a>
              <a href="/tags/vue/" rel="tag"><i class="fa fa-tag"></i> vue</a>
              <a href="/tags/%E5%B0%8F%E7%A8%8B%E5%BA%8F/" rel="tag"><i class="fa fa-tag"></i> 小程序</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2020/09/15/VueVSWechatMiniPro/" rel="prev" title="Vue和微信小程序的区别">
      <i class="fa fa-chevron-left"></i> Vue和微信小程序的区别
    </a></div>
      <div class="post-nav-item">
    <a href="/2020/10/13/Vue4waysForSEO/" rel="next" title="Vue项目SEO优化的4种方案">
      Vue项目SEO优化的4种方案 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    
  <div class="comments">
    <div id="lv-container" data-id="city" data-uid="MTAyMC81MDE2Ni8yNjY1Ng=="></div>
  </div>
  

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#什么是-uni-app"><span class="nav-number">1.</span> <span class="nav-text">什么是 uni-app?</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#标签-组件变化"><span class="nav-number">2.</span> <span class="nav-text">标签&#x2F;组件变化</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#html标签和uni-app内置组件的映射表"><span class="nav-number">2.1.</span> <span class="nav-text">html标签和uni-app内置组件的映射表</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#手机端新增常用新组件"><span class="nav-number">2.2.</span> <span class="nav-text">手机端新增常用新组件</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#js的变化"><span class="nav-number">3.</span> <span class="nav-text">js的变化</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#运行环境从浏览器变成v8引擎"><span class="nav-number">3.1.</span> <span class="nav-text">运行环境从浏览器变成v8引擎</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#dom操作，改成vue的MVVM模式"><span class="nav-number">3.2.</span> <span class="nav-text">dom操作，改成vue的MVVM模式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#js-api的变化"><span class="nav-number">3.3.</span> <span class="nav-text">js api的变化</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#CSS的变化"><span class="nav-number">4.</span> <span class="nav-text">CSS的变化</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#工程结构和页面管理"><span class="nav-number">5.</span> <span class="nav-text">工程结构和页面管理</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#参考资料"><span class="nav-number">6.</span> <span class="nav-text">参考资料</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Skygit"
      src="/images/avatar.gif">
  <p class="site-author-name" itemprop="name">Skygit</p>
  <div class="site-description" itemprop="description">专注于编程技术积累与分享</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">19</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">12</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">25</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/skygiter" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;skygiter" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://skygiter.github.io/atom.xml" title="RSS → https:&#x2F;&#x2F;skygiter.github.io&#x2F;atom.xml" rel="noopener" target="_blank"><i class="fa fa-rss fa-fw"></i>RSS</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://segmentfault.com/u/skygit" title="思否 → https:&#x2F;&#x2F;segmentfault.com&#x2F;u&#x2F;skygit" rel="noopener" target="_blank"><i class="fa fa-link fa-fw"></i>思否</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://weibo.com/skygit" title="Weibo → https:&#x2F;&#x2F;weibo.com&#x2F;skygit" rel="noopener" target="_blank"><i class="fab fa-weibo fa-fw"></i>Weibo</a>
      </span>
  </div>



      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright"><a href="http://www.beian.miit.gov.cn/" rel="noopener" target="_blank">鄂ICP备18002444号 </a>
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Skygit</span>
</div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>




  




  
<script src="/js/local-search.js"></script>













  

  

  

<script>
if(window.location.href.indexOf('skygiter.gitee.io')!=-1){
  document.querySelector('#lv-container').setAttribute("data-uid","MTAyMC81MDI3NS8yNjc2NQ==")
}
NexT.utils.loadComments(document.querySelector('#lv-container'), () => {
  window.livereOptions = {
    refer: location.pathname.replace(CONFIG.root, '').replace('index.html', '')
  };
  (function(d, s) {
    var j, e = d.getElementsByTagName(s)[0];
    if (typeof LivereTower === 'function') { return; }
    j = d.createElement(s);
    j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
    j.async = true;
    e.parentNode.insertBefore(j, e);
  })(document, 'script');
});
</script>

  
<script type="text/javascript" src="//cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script>

</body>
</html>
